package ru.lenwp.model;

import java.util.Date;

/**
 * Created by Lenar on 24.06.2014.
 */
public class OperationInfo {
    private long id;
    private Client client;
    private Date date;
    private String typeOperation;
    private boolean marker;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getTypeOperation() {
        return typeOperation;
    }

    public void setTypeOperation(String typeOperation) {
        this.typeOperation = typeOperation;
    }

    public boolean isMarker() {
        return marker;
    }

    public void setMarker(boolean marker) {
        this.marker = marker;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OperationInfo that = (OperationInfo) o;

        if (id != that.id) return false;
        if (marker != that.marker) return false;
        if (client != null ? !client.equals(that.client) : that.client != null) return false;
        if (date != null ? !date.equals(that.date) : that.date != null) return false;
        if (typeOperation != null ? !typeOperation.equals(that.typeOperation) : that.typeOperation != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (client != null ? client.hashCode() : 0);
        result = 31 * result + (date != null ? date.hashCode() : 0);
        result = 31 * result + (typeOperation != null ? typeOperation.hashCode() : 0);
        result = 31 * result + (marker ? 1 : 0);
        return result;
    }
}
